[eas-cli] Validate/regenerate/create provisioning profile in non-interactive iOS builds using submission ASC API key when present#3805
Open
sswrk wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3805 +/- ##
==========================================
+ Coverage 57.39% 57.42% +0.04%
==========================================
Files 909 909
Lines 39386 39417 +31
Branches 8247 8251 +4
==========================================
+ Hits 22603 22633 +30
Misses 15316 15316
- Partials 1467 1468 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7f69e93 to
622d427
Compare
622d427 to
012e745
Compare
…n non-interactive iOS build
012e745 to
15311b5
Compare
|
✅ Thank you for adding the changelog entry! |
sswrk
commented
May 29, 2026
Comment on lines
+191
to
+203
| /** | ||
| * The team type determines `team.inHouse`, which in turn selects the Apple profile | ||
| * type used for every subsequent profile lookup and creation (IOS_APP_INHOUSE for | ||
| * enterprise vs IOS_APP_STORE otherwise). We derive it from the distribution | ||
| * type, which is exactly what the requested operation needs: enterprise | ||
| * builds require an in-house team, other distribution types don't. | ||
| * A genuine team/distribution mismatch is rejected by Apple regardless of this value. | ||
| */ | ||
| private getDerivedTeamTypeForAuthentication(): AppleTeamType { | ||
| return this.distributionType === IosDistributionType.Enterprise | ||
| ? AppleTeamType.IN_HOUSE | ||
| : AppleTeamType.COMPANY_OR_ORGANIZATION; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Ideally, I would prefer to load the apple team type along the ASC API key from the www API. However, this would be unreliable as more then 95% apple team records don't have it specified.
|
Subscribed to pull request
Generated by CodeMention |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Many projects already configure an App Store Connect API key in EAS credentials for submissions, but non-interactive iOS App Store and Enterprise builds (
eas build --non-interactive) could not use that key when validating or repairing provisioning profiles on Apple servers. Instead, CI had to provideEXPO_ASC_*environment variables separately, even when a usable key was already stored on EAS.This makes non-interactive credential setup more convenient by reusing the EAS-stored submission ASC API key for App Store and Enterprise profile validation and repair.
How
tryAuthenticateAppStoreWithEasAscApiKeyAsyncinAscApiKeyUtils.ts— a best-effort, non-throwing helper that authenticatesctx.appStorein non-interactive mode using:EXPO_ASC_API_KEY_PATH/EXPO_ASC_KEY_ID/EXPO_ASC_ISSUER_IDenvironment variables, orSetUpProvisioningProfile.runAsync, call this helper before Apple-side validation when running non-interactively without an existing auth context.ctx.appStore.authCtx) instead of startupdefaultAuthenticationModewhen deciding whether Apple authentication is available inSetUpProvisioningProfile,CreateProvisioningProfile, andConfigureProvisioningProfile.resolveAscApiKeyForAppCredentialsAsync(previously duplicated inSetUpAdhocProvisioningProfile) for reuse across credential flows.AppleTeamTypefor profile operations from the distribution type (IN_HOUSEfor enterprise,COMPANY_OR_ORGANIZATIONotherwise), withEXPO_APPLE_TEAM_TYPEoverride.EXPO_ASC_*environment variables and EAS-stored ASC API keys.Out of scope: ad-hoc provisioning profile refresh (opt-in, handled separately via
--refresh-ad-hoc-provisioning-profile).Test Plan
SetUpProvisioningProfile-test.ts.easd build --platform ios --profile production --non-interactive)